Enhanced document readability on devices

ABSTRACT

A method for operating a device having a screen, including: obtaining, by the device, a first background image of an environment behind the screen; obtaining, by the device, an electronic document (ED) having a text character with an initial text color; identifying, by the device, a pixel in the first background image associated with the text character; determining, by the device, a first final text color based on the initial text color and the pixel in the first background image; and displaying, by the device and on the screen, the ED with the text character in the first final text color.

BACKGROUND

Devices with transparent, or at least partially transparent, displayscreens are becoming increasing popular. This is especially true fordevices that are mobile or even wearable. However, the environmentbehind the display screen can make it difficult to read text displayedon the screen. Specifically, the color of a displayed text character maybe sufficiently close to the color of the environment behind the screenthat reading the text becomes strenuous.

In addition, the environment behind the screen is unlikely to be static.Accordingly, the readability of displayed text may change over time. Anyattempt to continuously change the displayed text based on the changingenvironment behind the screen is likely to frustrate the user.Regardless, users still desire to view text on transparent, or partiallytransparent, screens.

SUMMARY

In general, in one aspect, the invention relates to a method foroperating a device comprising a screen. The method comprises: obtaining,by the device, a first background image of an environment behind thescreen; obtaining, by the device, an electronic document (ED) comprisinga text character with an initial text color; identifying, by the device,a pixel in the first background image associated with the textcharacter; determining, by the device, a first final text color based onthe initial text color and the pixel in the first background image; anddisplaying, by the device and on the screen, the ED with the textcharacter in the first final text color.

In general, in one aspect, the invention relates to a non-transitorycomputer readable medium (CRM) storing instructions for operating adevice comprising a screen. The instructions comprise functionality for:obtaining a first background image of an environment behind the screen;obtaining an electronic document (ED) comprising a text character withan initial text color; identifying a pixel in the first background imageassociated with the text character; determining a first final text colorbased on the initial text color and the pixel in the first backgroundimage; and displaying, on the screen of the device, the ED with the textcharacter in the first final text color.

In general, in one aspect, the invention relates to a device. The devicecomprises: a screen; a buffer storing an electronic document (ED)comprising a text character with an initial text color; a cameraconfigured to generate a first background image of an environment behindthe screen, wherein the first background image comprises a first pixelcorresponding to the text character; and a color module configured todetermine a first final text color for the text character based on thefirst pixel and the initial text color, wherein the ED is displayed onthe screen with the text character in the first final text color.

Other aspects of the invention will be apparent from the followingdescription and the appended claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 shows a system in accordance with one or more embodiments of theinvention.

FIG. 2-4 show flowcharts in accordance with one or more embodiments ofthe invention.

FIG. 5 shows an example in accordance with one or more embodiments ofthe invention.

DETAILED DESCRIPTION

Specific embodiments of the invention will now be described in detailwith reference to the accompanying figures. Like elements in the variousfigures are denoted by like reference numerals for consistency.

In the following detailed description of embodiments of the invention,numerous specific details are set forth in order to provide a morethorough understanding of the invention. However, it will be apparent toone of ordinary skill in the art that the invention may be practicedwithout these specific details. In other instances, well-known featureshave not been described in detail to avoid unnecessarily complicatingthe description.

In general, embodiments of the invention provide a device comprising ascreen, a method of operating a device comprising a screen, and acomputer readable medium storing instructions for operating a devicecomprising a screen. Specifically, a background image of the environmentbehind the screen is obtained, and then pixels in the background imageassociated with text to be displayed are identified. A final text coloris determined based on the color of the text specified in the electronicdocument (ED) and the pixels of the background image. The text appearson the screen in the final text color. At a future point, when a changein the environment has been detected, a new final text color isdetermined. The displayed text is transitioned from the final text colorto the new final text color in stages (i.e., not immediately orsuddenly).

FIG. 1 shows a device (100) in accordance with one or more embodimentsof the invention. As shown in FIG. 1, the device (100) has multiplecomponents including, for example, a buffer (104), a rendering engine(108), a camera (110), a screen (112), a color module (114), and anoverlay image engine (116). Each of these components is discussed below.Moreover, the device (100) may be a mobile computer device (e.g., smartphone, tablet PC, laptop, e-reader, etc.) and/or a wearable computerdevice (e.g., a pair of glasses, a watch, etc.). In one or moreembodiments, the device (100) is a stationary computer device (e.g., adesktop personal computer (PC), a kiosk, a server, a mainframe, a cablebox, etc.).

In one or more embodiments of the invention, the device (100) includes ascreen (112). The screen (112) may be transparent or at least partiallytransparent. Accordingly, a user viewing the screen (112) may alsoobserve the environment (150) behind the screen. The screen (112) may beof any resolution and capable of displaying text, graphics, images,videos, animation, etc. in any color. In embodiments where the device(100) is a pair of glasses, the screen (112) is located within a lens orspread across both lenses of the pair of glasses. Although FIG. 1 showsthe screen (112) as being part of the device (100), in one or moreembodiments of the invention, the screen (112) is external to the device(100). For example, the screen (112) may be a desktop monitor or atelevision that is separate from the device (100).

In one or more embodiments of the invention, the device (100) includes acamera (110). The camera (110) is configured to generate backgroundimages of the environment (150) behind the screen (112). The camera(110) may periodically generate background images of the environment(150). Additionally or alternatively, the camera (110) may generate abackground image of the environment (150) in response to a change in theenvironment (150) being detected. In embodiments where the device (100)is a pair of glasses, the camera (100) is attached to the pair ofglasses. For example, the camera (110) may be located within the frameof the pair of glasses or mounted on the frame. In other embodiments,the camera (110) may be mounted on an edge of the screen (112) orlocated within the screen (112). In one or more embodiments of theinvention, the device (100) includes an accelerometer (not shown) usedto detect the device (100) is in motion and thus the environment (150)is likely changing.

In one or more embodiments of the invention, the device (100) includes abuffer (104). The buffer (104) may be of any size and may be composed ofany type of memory or long-term storage (e.g., hard drive). As shown inFIG. 1, the buffer (104) holds/stores an electronic document (ED) (106)requested by the user for viewing. The ED (106) may include one or moretext characters, graphics, images, etc. to be displayed. The ED (106)may also specify one or more text colors for the one or more textcharacters. Examples of the ED (106) include web pages (e.g., hypertextmarkup language (HTML) files), portable document format (PDF) files,Open Office XML (OOXML) files or files generated using any markuplanguage, slide show presentations, spreadsheets, etc.

In one or more embodiments of the invention, the device (100) includes arendering engine (108). The rendering engine (108) is configured togenerate a rendered version of the ED (106) based on, for example, theone or more text characters and the one or more text colors specified inthe ED (106). Generating the rendered version of the ED (106) mayinclude calculating the positions (e.g., coordinates) of each textcharacter, image, graphic, etc. in the ED (106) based on any formattingattributes (e.g., line spacing, margins, paragraph spacing, borders,etc.) specified in the ED (106). In one or more embodiments of theinvention, the rendered version of the ED (106) is a set of pixelssuitable for display on the screen (112). When viewed together, this setpixels forms the text characters, images, graphics, etc. of the ED(106). Further, those pixels corresponding to the text characters, arecolored according to the text color specified in the ED (106).

In one or more embodiments of the invention, the rendering engine (108)is configured to generate/output a text tag bit (TTB) plane. The TTBplane is a grid of cells, with each cell corresponding to one of thepixels in the rendered version of the ED (106). Each cell stores a valuethat is dependent on the cell's corresponding pixel. For example, if apixel in the rendered ED is part of a text character, the cellcorresponding to the pixel may have the binary value “01”. If a pixel inthe rendered ED is part of an image, the cell corresponding to the pixelmay have the binary value “10”.

In one or more embodiments of the invention, the device (100) includesan overlay image engine (116). The overlay image engine (116) isconfigured to determine the pixels in the background image (e.g.,generated by the camera (110)) that are associated with the textcharacters of the ED (106). Specifically, the overlay image engine (116)may apply the TTB plane to the background image to identify the pixelsin the background image that are associated with the text characters inthe ED (106). Only the pixels of the background image thatoverlap/intersect cells of the TTB plane denoting text characters aredeemed to be associated with text characters.

In one or more embodiments of the invention, the overlay image engine(116) is configured to generate an overlay image. The overlay image maybe generated by making all pixels in the background image that are notassociated with text characters transparent. Generating the overlayimage may also include setting the pixels in the background image thatare associated with text characters to final text colors or intermediatetext colors (discussed below). Once the overlay image is generated, itmay be superimposed upon the rendered version of the ED (106) anddisplayed on the screen (112). As a result of the superposition, all ofthe text characters will appear in the final text colors or intermediatetext colors instead of the text colors specified in the ED (106).

In one or more embodiments of the invention, the device (100) includes acolor module (114). The color module (114) is configured to determinethe final text color for each pixel in the background image that isassociated with a text character. The final text color is effectively acolor that will make the text character easier to read on the screen(112) in view of the environment behind the screen. The final text colormay be determined in multiple ways. For example, the final text colormay be based on a greyscale value of the pixel (or an average greyscalevalue of pixels within the vicinity of the pixel) and the text colorspecified by the ED (106) for the associated text character. As anotherexample, the final text color may be determined based on a greyscalevalue of the pixel (or the average greyscale value of pixels within thevicinity of the pixel) and a darkness threshold. Intermediate textcolors may be considered incremental steps between an initial text colorand a final text color.

Although embodiments of the invention have been described with respectto superimposing an overlay image onto an existing rendered version ofthe ED, in one or more embodiments of the invention, the renderingengine (108) is configured to generate a rendered version of the ED(106) with the text characters already in the final text colors orintermediate text colors. In such embodiments, as a position for a textcharacter is calculated, the corresponding pixel in the background imageis identified. Then, the final text color or intermediate text color isdetermined before the ED is rendered, and applied to the glyph of thetext character. As a result, the rendered ED already has the textcharacters in the final text colors or intermediate text colors. In suchembodiments, the overlay image might not be required.

FIG. 2 shows a flowchart in accordance with one or more embodiments ofthe invention. The flowchart depicts a process for operating a devicecomprising a screen. One or more of the steps in FIG. 2 may be performedby the components of the device (100), discussed above in reference toFIG. 1. In one or more embodiments of the invention, one or more of thesteps shown in FIG. 2 may be omitted, repeated, and/or performed in adifferent order than the order shown in FIG. 2. Accordingly, the scopeof the invention should not be considered limited to the specificarrangement of steps shown in FIG. 2.

Initially, a background image of an environment behind the screen isobtained (STEP 205). The screen may be transparent, or at leastpartially transparent, and thus the environment behind the screen may bevisible to a user attempting to view the screen. The background imagemay be obtained by a camera that is attached to the device.

In STEP 210, an ED is obtained. The ED may specify one or more textcharacters to be displayed in one or more text colors (“initial textcolors”). The ED may also include graphics, images, animation, videos,etc. Accordingly, the ED may correspond to web pages (e.g., hypertextmarkup language (HTML) files), portable document format (PDF) files,Open Office XML (OOXML) files or files generated using any markuplanguage, slide show presentations, spreadsheets, etc.

In STEP 215, pixels in the background image associated with a textcharacter in the ED are identified. STEP 215 is described in detail inFIG. 3.

In STEP 220, a final text color for the text character is determined.The final text color may be determined based on the initial text color,specified in the ED, for the text character and the pixels in thebackground image associated with the text character. The final textcolor is better suited than the initial text color for viewing the textcharacter against the environment behind the screen. In other words, thefinal text color makes the text character easier to read when theenvironment behind the screen is considered. STEP 220 is described indetail in FIG. 3 STEP 215 and STEP 220 may be repeated for each textcharacter in the ED.

In STEP 225, the ED is displayed, on the screen, with the textcharacters in their final text colors. The user can easily read thedisplayed text characters because the final text colors are sufficientlycontrasted with the colors in the environment. STEP 225 is described indetail in FIG. 3

FIG. 3 shows a flowchart in accordance with one or more embodiments ofthe invention. Some steps in the flowchart of FIG. 3 further expand STEP215, STEP 220, and/or STEP 225 in FIG. 2. One or more of the steps inFIG. 3 may be performed by the components of the device (100), discussedabove in reference to FIG. 1. In one or more embodiments of theinvention, one or more of the steps shown in FIG. 3 may be omitted,repeated, and/or performed in a different order than the order shown inFIG. 3. Accordingly, the scope of the invention should not be consideredlimited to the specific arrangement of steps shown in FIG. 3.

Initially, a TTB plane is generated based on a rendered version of theED. The TTB plane is a grid of cells, with each cell corresponding toone pixel in the rendered version of the ED. Further, each cell stores avalue that depends on whether the corresponding pixel is part of a textcharacter, an image, a graphic, etc. For example, if a pixel in therendered ED is part of a text character, the cell in the TTB planecorresponding to the pixel may have the binary value “01”. If a pixel inthe rendered ED is part of an image, the cell in the TTB planecorresponding to the pixel may have the binary value “10”.

In STEP 310, the TTB plane is applied to the background image (e.g., thebackground image in STEP 205). The TTB plane is applied to identify: (i)which pixels in the background image are associated with text charactersin the ED; (ii) which pixels in the background image are associated withimages in the ED; (iii) which pixels in the background image areassociated with graphics in the ED, etc. Specifically, pixels in thebackground image that intersect/overlap with cells denoted as textcharacters are deemed to be associated with text characters. Similarly,pixels in the background image that intersect/overlap with cells denotedas graphics are deemed to be associated with graphics, etc. In anotherexample and alternatively, pixels in the background image that surroundthe cells denoted as text characters are deemed to be associated withtext characters.

In STEP 315, a greyscale value is calculated based on the pixels in thebackground image associated with a text character. In one or moreembodiments of the invention, the greyscale value (K_(P)) of a pixel inthe background image having a red component (R_(P)), a green component(G_(P)), and blue component (B_(P)) is calculated as:

K _(P) =R _(P)*0.3+G _(P)*0.59+B _(P)*0.11

This calculation may be performed for each pixel in a set of pixels inthe background image associated with the text character. For example,the set of pixels may correspond to the pixels within a rectangular (orother shaped) region of the background image that enclose/surround thetext character, that enclose/surround a word that has the textcharacter, that enclose/surround a sentence or paragraph that includesthe text character. These multiple greyscale values of the multiplepixels may then be averaged. Those skilled in the art, having thebenefit of this detailed description, will appreciate that otheralgorithms may be used to calculate a greyscale value.

Those skilled in the art, having the benefit of this detaileddescription, will appreciate that the final text color for a given pixelis calculated to maximize contrast with the environment behind thescreen. The W3C recommends a contrast in gray values between aforeground and background image to be at least 125.

In one or more embodiments of the invention, if the greyscale value isgreater than a darkness threshold (e.g., 127), the target overlay coloris deemed to be black. In one or more embodiments of the invention, ifthe greyscale value is less than or equal to the darkness threshold, thetarget overlay color is deemed to be white. Using either black or whiteguarantees that pixel contrast will be at least 125.

In STEP 320, a color scale (C_(S)) is calculated based on the greyscalevalue (K_(P)). The color scale may be calculated as:

Cs=|(K _(P)−125)/255|

In STEP 325, a final text color is calculated based on the color scaleand the initial text color for the text character (i.e., the text colorspecified in the ED). Let R_(D), G_(D), and B_(D) represent the redcomponent, the green component, and the blue component, respectively, ofthe initial text color for the text character. The unscaled red (R_(U))channel, unscaled green (G_(U)) channel, and unscaled blue (B_(U))channel of the final text color are calculated as:

R _(U) =R _(D)−MIN(R _(D) ,G _(D) ,B _(D))

G _(U) =G _(D)−MIN(R _(D) ,G _(D) ,B _(D))

B _(U) =B _(D)−MIN(R _(D) ,G _(D) ,B _(D))

The calculation of the final text color may also depend on whether thetarget overlay color was deemed to be black or white (discussed above inreference to STEP 315). If the target overlay color was deemed to beblack, the final text color (R_(S), G_(S), B_(S)) is calculated as:

R _(S) =C _(S) *R _(U)

G _(S) =C _(S) *G _(U)

B _(S) =C _(S) *B _(U)

If the target overlay color was deemed to be white, the final text color(R_(S), G_(S), B_(S)) is calculated as:

R _(S)=255−(C _(S) *R _(U))

G _(S)=255−(C _(S) *G _(U))

B _(S)=255−(C _(S) *B _(U))

In one or more embodiments of the invention, STEP 325 is optional. Insuch embodiments, the final text color is the target overlay colordetermined as part of STEP 320. However, by using the final text colorcalculated in STEP 325, some color differences (i.e., differencesbetween different colors specified in the ED) will be retained.

In STEP 330, pixels in the background image associated with the textcharacter are set to the final text color. STEP 315, STEP 320, STEP 325,and STEP 330 may be performed for each text character in the ED.Further, all pixels in the background image that are not associated witha text character may be made transparent. STEP 330 effectivelytransforms the background image into an overlay image.

In STEP 335, the overlay image is superimposed upon the rendered versionof the ED, and the superimposed image is displayed on the screen. Allthe text characters in the ED appear in their respective final textcolors. Further, the graphics and images of the ED are viewed andunaffected by the overlay image.

FIG. 4 shows a flowchart in accordance with one or more embodiments ofthe invention. In one or more embodiments of the invention, the processin FIG. 4 takes place after the ED is displayed, for some predeterminedtime, with the text characters in the final text color(s). One or moreof the steps in FIG. 4 may be performed by the components of the device(100), discussed above in reference to FIG. 1. In one or moreembodiments of the invention, one or more of the steps shown in FIG. 4may be omitted, repeated, and/or performed in a different order than theorder shown in FIG. 4. Accordingly, the scope of the invention shouldnot be considered limited to the specific arrangement of steps shown inFIG. 4.

Initially, it is determined whether there has been a change in theenvironment behind the screen (STEP 405). For example, if the user ismoving (as detected by an accelerometer), it is highly likely there hasbeen a change in the environment behind the screen. When it isdetermined that the environment has changed, the process proceeds toSTEP 410.

In STEP 410, a new background image is obtained. STEP 410 is essentiallythe same as STEP 205, discussed above in FIG. 2

In STEP 415, pixels in the background image associated with a textcharacter in the ED are identified. STEP 415 is essentially the same asSTEP 215, discussed above in reference to FIG. 2.

In STEP 420, a new final text color for the text character is determinedbased on the new background image and the initial text color for thetext character. STEP 420 is essentially the same as STEP 220 discussedabove in reference to FIG. 2 STEP 415 and STEP 420 may be performed forall text characters in the ED.

In STEP 425, each displayed text character is transitioned from itsfinal text color to its new final text color over multiple stages.Specifically, each text character is displayed in various intermediatecolors until reaching its new final text color. For a given textcharacter, let R_(F), G_(F), and B_(F) be the red component, the greencomponent, and the blue component, respectively, of the final textcolor. This is the color the user is currently viewing on the screen.Let R_(NF), G_(NF), and B_(NF), be the red component, the greencomponent, and the blue component, respectively, of the new final textcolor. An intermediate text color (R_(I), G_(I), B_(I)) for the textcharacter may be calculated as:

R _(I) =R _(F)+(I*(R _(NF) −R _(F))/T)

G _(I) =G _(F)+(I*(G _(NF) −G _(F))/T)

B _(I) =B _(F)+(I*(B _(NF) −B _(F))/T)

T is the total number of stages. Therefore, 1≦I≦T. The timing betweenstages must be slow enough not to frustrate the user. In fact, thetiming between stages may be a user preference. At each stage, thepixels in the overlay image are updated/set to the appropriateintermediate text color. As a result, the superimposed image nowdisplays the text characters in the intermediate text color(s).Eventually, once the final stage is reached, the superimposed image willhave each text character in its new final text color.

The disclosed embodiments have focused primary on the use of an overlayimage to achieve the intermediate text colors. In one or moreembodiments of the invention, the rendering engine (108) is configuredto re-render the ED (106) for each stage of the transition. Suchembodiments require determining the intermediate text color before theED is re-rendered because the intermediate text color is applied to theglyph of the text character(s) during the rendering. One potentialbenefit of such embodiments is that no overlay image or TTB plane isneeded.

FIG. 5 shows an example in accordance with one or more embodiments ofthe invention. As shown in FIG. 5, there exists a rendered ED (501). Therendered ED (501) includes a text character in an initial text color(502). There also exists a TTB plane (504) for the rendered ED (501).The TTV plane (504) is a grid with multiple cells (e.g., Cell A (506),Cell B (508)). Each cell corresponds to a pixel of the rendered ED(501). Cell A (506) corresponds to a pixel in the rendered ED (501) thatforms the text character (502). Cell B (508) does not correspond to apixel in the rendered ED (501) that forms a text character. Accordingly,Cell A (506) and Cell B (508) store different values.

Assume background image (510) is an image of the environment behind onthe screen on which the ED will be displayed. By applying (512) the TTBplane (504) to the background image (510), is possible to identifypixels (514) of the background image that are associated with the textcharacter (502). The overlay image (516) may be generated by making allpixels in the background image that are not associated with the textcharacter transparent (520). The overlay image (516) is also generatedby setting pixels in the background image associated with the textcharacter to the final text color (518).

The superimposed image (522) may be generated by superimposing theoverlay image (516) upon the rendered ED (501). As shown in FIG. 5, thegraphics of the rendered ED (501) do not change. However, the textcharacter is now displayed in the final text color (524), not theinitial text color. The final text color (524) is easier to read becausethere is greater contrast between the final text color and theenvironment behind the screen on which the superimposed image (522) isdisplayed.

Embodiments of the invention have the following advantages: the abilityto improve readability of text on a transparent or partially transparentscreen; the ability to transition text color from an initial text colorto a final text color over multiple stages; the ability to generate asuperimposed image from the rendered ED and an overlay image; theability to at least partially preserve differences between differentinitial text colors specified in the ED, etc.

Software instructions in the form of computer readable program code toperform embodiments of the invention may be stored, in whole or in part,temporarily or permanently, on a non-transitory computer readable mediumsuch as a CD, DVD, storage device, a diskette, a tape, flash memory,physical memory, or any other computer readable storage medium.Specifically, the software instructions may correspond to computerreadable program code that when executed by a processor(s), isconfigured to perform embodiments of the invention.

While the invention has been described with respect to a limited numberof embodiments, those skilled in the art, having benefit of thisdisclosure, will appreciate that other embodiments can be devised whichdo not depart from the scope of the invention as disclosed herein.Accordingly, the scope of the invention should be limited only by theattached claims.

What is claimed is:
 1. A method for operating a device comprising ascreen, comprising: obtaining, by the device, a first background imageof an environment behind the screen; obtaining, by the device, anelectronic document (ED) comprising a text character with an initialtext color; identifying, by the device, a pixel in the first backgroundimage associated with the text character; determining, by the device, afirst final text color based on the initial text color and the pixel inthe first background image; and displaying, by the device and on thescreen, the ED with the text character in the first final text color. 2.The method of claim 1, wherein the device is a pair of glasses, whereinthe screen is located in a lens of the pair of glasses, and wherein thebackground image is generated by a camera attached to the pair ofglasses.
 3. The method of claim 1, wherein identifying the pixel in thefirst background image comprises: generating, from a rendered version ofthe ED, a text tag bit (TTB) plane comprising a plurality of cellscorresponding to a plurality of pixels of the rendered version; andapplying the TTB plane to the first background image.
 4. The method ofclaim 3, wherein displaying the ED comprises: setting the pixel in thefirst background image to the first final text color to generate anoverlay image; and superimposing the overlay image upon the renderedversion of the ED.
 5. The method of claim 1, wherein determining thefirst final text color comprises: calculating a greyscale value based onthe pixel in the first background image; calculating a color scale basedon the greyscale value; and multiplying the color scale with a redcomponent, a green component, and a blue component of the initial textcolor.
 6. The method of claim 1, wherein determining the first finaltext color comprises: comparing the pixel to a darkness threshold,wherein the first final text color is selected as white in response tothe darkness threshold being exceeded.
 7. The method of claim 1, whereinthe pixel in the first background image is identified before the ED isrendered, wherein the first final text color is determined before the EDis rendered, and wherein the text character has a glyph, and wherein thefirst final text color is applied to the glyph during rendering of theED.
 8. The method of claim 1, further comprising: determining a changein the environment behind the screen; obtaining, by the device, a secondbackground image of the environment behind the screen; identifying, bythe device, a pixel in the second background image associated with thetext character; calculating, by the device, a second final text colorbased on the initial text color and the pixel in the second backgroundimage; and transitioning, by the device and while the ED is displayed,the text character from the first final text color to the second finaltext color over a plurality of stages.
 9. A non-transitory computerreadable medium (CRM) storing instructions for operating a devicecomprising a screen, the instructions comprising functionality for:obtaining a first background image of an environment behind the screen;obtaining an electronic document (ED) comprising a text character withan initial text color; identifying a pixel in the first background imageassociated with the text character; determining a first final text colorbased on the initial text color and the pixel in the first backgroundimage; and displaying, on the screen of the device, the ED with the textcharacter in the first final text color.
 10. The non-transitory CRM ofclaim 9, wherein the instructions for identifying the pixel in the firstbackground image comprise functionality for: generating, from a renderedversion of the ED, a text tag bit (TTB) plane comprising a plurality ofcells corresponding to a plurality of pixels of the rendered version;and applying the TTB plane to the first background image.
 11. Thenon-transitory CRM of claim 10, wherein the instructions for displayingthe ED comprise functionality for: setting the pixel in the firstbackground image to the first final text color to generate an overlayimage; and superimposing the overlay image upon the rendered version ofthe ED.
 12. The non-transitory CRM of claim 9, wherein the instructionsfor determining the first final text color comprise functionality for:calculating a greyscale value based on the pixel in the first backgroundimage; calculating a color scale based on the greyscale value; andmultiplying the color scale with a red component, a green component, anda blue component of the initial text color.
 13. The non-transitory CRMof claim 9, the instructions further comprising functionality for:determining a change in the environment behind the screen; obtaining asecond background image of the environment behind the screen;identifying a pixel in the second background image associated with thetext character; calculating a second final text color based on theinitial text color and the pixel in the second background image; andtransitioning, while the ED is displayed, the text character from thefirst final text color to the second final text color over a pluralityof stages.
 14. The non-transitory CRM of claim 9, wherein the device isa pair of glasses, wherein the screen is located in a lens of the pairof glasses, and wherein the background image is generated by a cameraattached to the pair of glasses.
 15. A device, comprising: a screen; abuffer storing an electronic document (ED) comprising a text characterwith an initial text color; a camera configured to generate a firstbackground image of an environment behind the screen, wherein the firstbackground image comprises a first pixel corresponding to the textcharacter; and a color module configured to determine a first final textcolor for the text character based on the first pixel and the initialtext color, wherein the ED is displayed on the screen with the textcharacter in the first final text color.
 16. The device of claim 15,further comprising: a rendering engine configured to apply the firstfinal text color to a glyph of the text character during rendering ofthe ED, wherein the first final text color is determined prior torendering the ED.
 17. The device of claim 15, further comprising: arendering engine configured to generate a rendered version of the ED;and an overlay image engine configured to generate an overlay image by:applying a text tag bit (TTB) plane to the first background image,wherein the TTB plane comprises a plurality of cells corresponding to aplurality of pixels of the rendered version of the ED; and setting thefirst pixel in the first background image to the first final text color,wherein the overlay image is superimposed upon the rendered version ofthe ED on the screen to display the text character in the first finaltext color.
 18. The device of claim 15, wherein the screen is located ina lens of a pair of glasses, and wherein the camera is attached to thepair of glasses.
 19. The device of claim 15, wherein: the camera isfurther configured to generate a second background image of theenvironment following a change in the environment; the second backgroundimage comprises a second pixel associated with the text character; thecolor module is further configured to determine a second final textcolor for the text character based on the second pixel and the initialtext color; and the text character is transitioned from the first finaltext color to the second final text color while the ED is displayed onthe screen.
 20. The device of claim 15, wherein the color module isfurther configured to: calculate a greyscale value based on the pixel inthe first background image; calculate a color scale based on thegreyscale value; and multiply the color scale with a red component, agreen component, and a blue component of the initial text color.